package cerebrum.entity;

import java.time.LocalDateTime;

/**
 * 鼠标键盘操作时，监听任务就往自定义队列中添加数据
 */
public class UsageTimeCacheEntity {
    //自定义队列
    private static volatile MyLinkedBlockingDeque<LocalDateTime> dateDeque = new MyLinkedBlockingDeque<>(1);
    //记录上次操作时间
    private static volatile LocalDateTime lastDate = LocalDateTime.now();


    public static LocalDateTime getDateTimes() {
        return dateDeque.poll();
    }

    public static void setDateTimes(LocalDateTime dateTimes) {
        dateDeque.add(dateTimes);
    }

    public static LocalDateTime getLastDate() {
        return lastDate;
    }

    public static void setLastDate(LocalDateTime date) {
        lastDate = date;
    }

}
